<?php
/**
* quickstat-data.php
*/
include_once("config/config.inc.php");
$status = $_POST["status"] ? $_POST["status"] : 1;
$sql = " select a.room_id, a.door_name, c.floor_label, d.room_type_name, b.status_name, a.last_update 
from rooms a, statuses b, floors c, room_types d 
where a.status=b.status_id and a.floor_id=c.floor_id and a.room_type_id=d.room_type_id and a.status=$status";
$res = mysql_query($sql);
$ctr = 0;
$retval = "";
$ctr = 0;
while($row=mysql_fetch_array($res)) {
	$retval.=($ctr)?",":"";
	$retval.=json_encode($row);
	$ctr++;
}
 
echo '{rooms: ['. $retval. ']}';
?>